import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
      {
        path: '/',
        component: () => import('@/layouts/BasicLayout.vue'), // 使用布局组件
        children: [
          {
            path: '',
            redirect: '/dashboard'
          },
          {
            path: '/dashboard',
            name: 'Dashboard',
            component: () => import('@/views/dashboard/index.vue'),
            meta: { title: 'Dashboard' }
          },
          {
            path: '/sendSms',
            name: 'SendSms',
            component: () => import('@/views/sms/index.vue'),
            meta: { title: 'SendSms' }
          }
        ]
      },
    // {
    //   path: '/',
    //   redirect: '/dashboard'
    // },
    {
      path: '/order',
      name: 'order',
      component: () =>  import('@/views/imgOrder/index.vue'),
      meta: { title: 'Order' }
    },
    {
      path: '/info/:sn',
      name: 'info',
      component: () =>  import('@/views/imgOrder/info.vue'),
      meta: { title: 'Info' }
    },
    // {
    //   path: '/sendSms',
    //   name: 'SendSms',
    //   component: () =>  import('../views/sms/index.vue'),
    //   meta: { title: 'SendSms' }
    // },
  ],
})

export default router
